﻿#include"simpleLog.h"

#include <string>

std::string GettCurrTimeInfo();


Logger::Logger() :
  logFilePath("log.txt"), logFile(logFilePath, std::ios::app | std::ios::binary),
  timeStr(GettCurrTimeInfo())
{
  if (!logFile.is_open()) {
    std::cerr << "无法打开日志文件: " << logFilePath << std::endl;
    return;
  }
  OutPutCurrTimeInfo();
}

void Logger::OutPutCurrTimeInfo() {
  // 格式化输出日期和时间
  logFile << std::endl << "当前日期和时间: " << timeStr << std::endl;
}
